﻿using System.Drawing;
using System.Windows.Forms;
using Map;
using Map_Creator.MapInfo;

namespace Map_Creator.AutoTileEditor
{
    public partial class AutoTileEditor : Form
    {
        public AutoTileData TileResult;

        public AutoTileEditor(TileSet set, AutoTile tile)
        {
            InitializeComponent();

            TileSetControl.Initialize(set);

            autoTilesDesigner1.Initialize(tile,set,TileSetControl,redoUndoStrip1);

            TileSetPanel.Width = set.TilesImage.Width + SystemInformation.VerticalScrollBarWidth;
            TileSetControl.Width = set.TilesImage.Width;
            TileSetControl.Height = set.TilesImage.Height;
            Size = new Size(TileSetPanel.Width + autoTilesDesigner1.Right  + 50,Size.Height);
        }

        private void SaveButton_Click(object sender, System.EventArgs e)
        {
            DialogResult = DialogResult.OK;
            TileResult = autoTilesDesigner1.GetAnimatedTile();
        }
    }
}
